package com.retrofit.library.callback;

import com.retrofit.library.entity.Entity;

/**
 * desc:    实体类回调
 * date:    2017/9/9/0023
 */
public abstract class EntityReqCallback<T> extends RespCallback<Entity<T>> {

    @Override
    public void onSuccess(Entity<T> t) {
        if (t.getCode().equals("0000")) {
            parseData(t.getData());
        } else {
            onError(t.getCode(), t.getMsg());
        }
    }

    protected abstract void parseData(T t);


}
